package com.usian.common.model.competition;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.ToString;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.Transient;
import java.util.Date;

/**
 * @projectName: day05_mohongwei_parent
 * @package: com.jiyun.common.model.competition
 * @className: Competition
 * @author: 莫洪维
 * @email: 1204315800@qq.com
 * @description: TODO
 * @date: 2023/8/9 11:31
 */
@Data
@ToString
@TableName(value = "competition")
public class Competition {
    @TableId(value = "id",type = IdType.AUTO)
    private Long id;
    @TableField(value = "photo_url")
    private String photoUrl;
    @TableField(value = "competition_name")
    private String competitionName;
    @TableField(value = "competition_type")
    private String competitionType;
    @TableField(value = "answer_method")
    private String answerMethod;
    @TableField(value = "scoring_mode")
    private String scoringMode;
    @TableField(value = "apply_num")
    private Integer applyNum;
    @TableField(value = "upper_limit")
    private Integer upperLimit;
    @TableField(value = "competition_plan")
    private String competitionPlan;
    @TableField(value = "participant")
    private String participant;
    @TableField(value = "start_date_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date startDateTime;
    @TableField(value = "end_date_time")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "Asia/Shanghai")
    private Date endDateTime;
    @TableField(value = "competition_sort")
    private Integer competitionSort;
    @TableField(value = "competition_status")
    private String competitionStatus;
    @TableField(value = "poster")
    private String poster;
    @TableField(value = "announcement")
    private String announcement;
    @TableField(value = "is_delete")
    private Integer isDelete;

    //标签ID
    @Transient
    @TableField(exist = false)
    private String labelIds;

    //成员ID
    @Transient
    @TableField(exist = false)
    private String memberIds;
}
